#include <cstdio>

__int64 c[ 59 ][ 59 ], f[ 59 ];

__int64 C( int x, int y )
{
    if ( y == 0 )
        return c[ x ][ y ] = 1;
    if ( c[ x ][ y ] != -1 )
        return c[ x ][ y ];
    else
        return c[ x ][ y ] = C( x, y - 1 ) * ( x - y + 1 ) / y;
}

int main( )
{
    int i, j, n, k;
    for ( i = 0; i < 59; i++ )
        for ( j = 0; j < 59; j++ )
            c[ i ][ j ] = -1;
    f[ 0 ] = f[ 1 ] = 0;
    f[ 2 ] = 1;
    for ( i = 3; i < 59; i++ )
    {
        f[ i ] = 0;
        for ( j = 2; j <= i; j++ )
            f[ i ] += C( i, j ) * ( j - 1 );
    }
    while ( scanf("%d", &n) != EOF )
        printf("%I64d\n", f[ n ]);
    return 0;
}
